package entity;

/**
 * ClassbyKeyWordId entity. @author MyEclipse Persistence Tools
 */

public class ClassbyKeyWordId implements java.io.Serializable {

	// Fields

	private Keyword keyword;
	private Contest contest;

	// Constructors

	/** default constructor */
	public ClassbyKeyWordId() {
	}

	/** full constructor */
	public ClassbyKeyWordId(Keyword keyword, Contest contest) {
		this.keyword = keyword;
		this.contest = contest;
	}

	// Property accessors

	public Keyword getKeyword() {
		return this.keyword;
	}

	public void setKeyword(Keyword keyword) {
		this.keyword = keyword;
	}

	public Contest getContest() {
		return this.contest;
	}

	public void setContest(Contest contest) {
		this.contest = contest;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ClassbyKeyWordId))
			return false;
		ClassbyKeyWordId castOther = (ClassbyKeyWordId) other;

		return ((this.getKeyword() == castOther.getKeyword()) || (this
				.getKeyword() != null && castOther.getKeyword() != null && this
				.getKeyword().equals(castOther.getKeyword())))
				&& ((this.getContest() == castOther.getContest()) || (this
						.getContest() != null && castOther.getContest() != null && this
						.getContest().equals(castOther.getContest())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getKeyword() == null ? 0 : this.getKeyword().hashCode());
		result = 37 * result
				+ (getContest() == null ? 0 : this.getContest().hashCode());
		return result;
	}

}